Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [OSM-1122] improve workspaces parsing #234

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

gemaxim
Copy link
Contributor

@gemaxim gemaxim commented Jul 16, 2024

What this does

Added specific parser for a workspace.
It takes projects belonging to the workspace from the lockfile importers. This way, several path computations are avoided (that were performed here: https://github.com/snyk/snyk-nodejs-plugin/pull/16/files)

extractPackages function should perform parsing of packages only once per parser. This was a problem for workspaces before these changes, it was called for every package.json in the workspace.

Removed some code that is not needed anymore (e.g. specifier in the package that's added to dep graph).

Next changes: add a cache for workspaces for the cases where a local package is referenced by another one. We should keep a map of every top "importer" local package and its dependencies, to not compute them every time they are referenced.

@gemaxim gemaxim force-pushed the feat/OSM-1122/pnpm-workspaces-parsing branch from f4897df to 50fc9de Compare July 16, 2024 08:04
@gemaxim gemaxim self-assigned this Jul 16, 2024
@gemaxim gemaxim marked this pull request as ready for review July 16, 2024 08:10
@gemaxim gemaxim requested a review from a team as a code owner July 16, 2024 08:10
@gemaxim gemaxim force-pushed the feat/OSM-1122/pnpm-workspaces-parsing branch from 50fc9de to 20fd57c Compare July 16, 2024 08:20
@gemaxim gemaxim force-pushed the feat/OSM-1122/pnpm-workspaces-parsing branch from 20fd57c to 709833d Compare July 17, 2024 10:17
@gemaxim gemaxim force-pushed the feat/OSM-1122/pnpm-workspaces-parsing branch from 709833d to 63aef6c Compare July 17, 2024 10:24
@gemaxim gemaxim merged commit 2cf2eee into main Jul 18, 2024
2 checks passed
@gemaxim gemaxim deleted the feat/OSM-1122/pnpm-workspaces-parsing branch July 18, 2024 08:27
@snyksec
Copy link

snyksec commented Jul 18, 2024

🎉 This PR is included in version 1.58.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants